package com.ysd.lis.controller.sys;


import com.ysd.common.Result;
import com.ysd.lis.annotation.LogDetail;
import com.ysd.lis.aspect.OperationType;
import com.ysd.lis.controller.pub.BaseController;
import com.ysd.lis.request.ModeUrlAddParam;
import com.ysd.lis.service.SysModeUrlService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * <p>
 *  前端控制器
 * </p>
 *
 * @author LiuQi
 * @since 2023-12-19
 */
@Api(tags = "模式url")
@RestController
@RequestMapping("/sys/modeUrl")
public class SysModeUrlController extends BaseController {

    @Autowired
    public SysModeUrlService sysModeUrlService;
    @ApiOperation("获取模式路径列表")
    @GetMapping("/findModeUrlListByMenuId/{menuId}")
    public Result findModeUrlListByMenuId(@PathVariable("menuId") String menuId) {
        return sysModeUrlService.getModeUrlListByMenuId(menuId);
    }

    @ApiOperation("添加模式路径")
    @PostMapping("/addModeUrl")
    @LogDetail(requestParam ="addModeUrl",operationType = OperationType.INSERT, module = "模式路径",content = "增加【modeName】模式信息", businessName = "modeName")
    public Result addModeUrl(@RequestBody ModeUrlAddParam modeUrlAddParam) {
        return sysModeUrlService.addModeUrl(modeUrlAddParam);
    }

    @ApiOperation("编辑模式路径")
    @PostMapping("/editModeUrl")
    @LogDetail(requestParam ="editModeUrl",operationType = OperationType.UPDATE, module = "模式路径",content = "编辑【modeName】模式信息", businessName = "modeName")
    public Result ditModeUrl(@RequestBody ModeUrlAddParam modeUrlAddParam) {
        return sysModeUrlService.editModeUrl(modeUrlAddParam);
    }

    @ApiOperation("删除模式路径")
    @PostMapping("/deleteModeUrl")
    @LogDetail(requestParam ="deleteModeUrl",operationType = OperationType.DELETE, module = "模式路径",content = "删除【modeName】模式信息", businessName = "modeName")
    public Result deleteModeUrl(@RequestBody ModeUrlAddParam modeUrlAddParam) {
       return  sysModeUrlService.deleteModeUrl(modeUrlAddParam);
    }
}
